<%@ page language="java" contentType="text/html; charset=utf-8"
	import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.adl.hotelmanage.po.adminuser"%>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>新用户注册</title>
<link rel="stylesheet" href="css/login.css" type="text/css" />
<link rel="shortcut icon" href="#" />
<link type="text/css" rel="stylesheet" href="font/font-awesome.min.css" />
<script
	src="http://cdn.static.runoob.com/libs/jquery/1.10.2/jquery.min.js">
	
</script>
<script type="text/javascript">
	var xmlrequest;
	function createXMLHttpRequest() {
		if (window.XMLHttpRequest) {
			xmlrequest = new XMLHttpRequest();
		} else if (window.ActiveXObject) {
			try {
				xmlrequest = new ActiveXObject("Msxm12.XMLHTTP");
			} catch (e) {
				try {
					xmlrequest = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {
				}
			}
		}
	}

	function register() {
		createXMLHttpRequest();
		//alert("aaaaaaaaaa");
		var user_userName = document.getElementById("user_userName").value;
		var user_userPass = document.getElementById("user_userPass").value;
		var user_userPass1 = document.getElementById("user_userPass1").value;
		// alert(user_userPass1);

		var url = "./RegisterServlet?user_userName=" + user_userName
				+ "&user_userPass=" + user_userPass + "&user_userPass1="
				+ user_userPass1;//+"&user1="+user1

		xmlrequest.open("POST", url, true);
		xmlrequest.setRequestHeader("Content-Type",
				"application/x-www-form-urlencoded");
		//alert("aaaaaaaaaeeeeeeeeeeeea");

		xmlrequest.onreadystatechange = function() {
			if (xmlrequest.readyState == 4) {
				if (xmlrequest.status == 200) {
					var msg = xmlrequest.responseText;
					if (msg == "ff") {
						alert('用户名已注册!');
						user_userName = "";
						user_userPass = "";
						return false;
					} else {
						if (msg == "hh") {

							alert('两次密码不同，请重新确认!');
						} else {
							window.location.href = "RegisterSuccess.jsp?user_userName="
									+ user_userName
									+ "&user_userPass="
									+ user_userPass;
						}

					}

				}

			}

		};

		xmlrequest.send("user_userName=" + user_userName + "&user_userPass="
				+ user_userPass + "&user_userPass1=" + user_userPass1);//+"&user1"+user1

	}
</script>


</head>

<body>
	<!-- <div class="pd-20">
  <div class="Huiform">
    <form action="" method="post">
      <table class="table table-bg">
        <tbody>
          <tr>
            <th width="100" class="text-r"><span class="c-red">*</span>姓名：</th>
            <td><input type="text" style="width:200px" class="input-text" value="" placeholder="" id="user_userName" name="user_userName" datatype="*2-16" nullmsg="用户名不能为空"></td>
          </tr>
          <tr>
            <th class="text-r"><span class="c-red">*</span> 密码：</th>
            <td><input type="text" type="password" style="width:300px" class="input-text" value="" placeholder="" id="user_userPass" name="user_userPass" datatype="*4-16" nullmsg="密码不能为空"></td>
          </tr>
         
            <td><button id="qr" onclick="register()">确认</button></td>
          </tr>
        </tbody>
      </table>
    </form>
  </div>
</div> -->


	<div class="loginbox">
		<div class="loginboxinner">

			<div class="logo">
				<h1 class="logo">
					马尔代夫大酒店.<span>用户注册</span>
				</h1>
				<span class="slogan"></span>
			</div>
			<div class="username">
				<div class="usernameinner">
					<input type="text" name="user_userName" id="user_userName"
						placeholder="用户名" />
				</div>
			</div>

			<div class="password">
				<div class="passwordinner">
					<input type="password" name="user_userPass" id="user_userPass"
						placeholder="密码" />
				</div>
			</div>
			<div class="password">
				<div class="passwordinner">
					<input type="password" name="user_userPass1" id="user_userPass1"
						placeholder="确认密码" />
				</div>
			</div>
			<div style="float: right; text-align: right"></div>

			<button id="qr" type="button" onclick="register()">注册</button>



		</div>
	</div>

	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript" src="js/Validform_v5.3.2_min.js"></script>
	<script type="text/javascript" src="js/H-ui.js"></script>
	<script type="text/javascript" src="js/H-ui.admin.js"></script>
	<script type="text/javascript">
		$(".Huiform").Validform();
	</script>

</body>
</html>
